{% extends 'base.html' %}
{% from 'bootstrap/pagination.html' import render_pagination %}
{% block body %}
    <div class="container">
    {% if posts %}
        {% for post in posts %}
            <h3 class="text-primary">
                <a href="{{ url_for('blog.show_post',post_id=post.id) }}"></a>
            {{ post.title }}
                <small>{{ moment(post.timestamp).fromNow(refresh=True) }}</small>
            </h3>
            <p>
            {{ post.body|striptags|truncate }}
            <small>
                <a href="{{ url_for('blog.show_post',post_id=post.id) }}">
                    detail
                </a>
            </small>
            </p>
        {% endfor %}
    {% endif %}
    <div class="page-footer">
        {{ render_pagination(pagination) }}
    </div>

    </div>
    <img src="https://open.weixin.qq.com/connect/qrcode/0114lmTz4V0eGa1b">
{% endblock %}